﻿<UserControl x:Class="UnityEditor.Controls.ComponentControl.ComponentControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
             xmlns:xna="clr-namespace:Microsoft.Xna.Framework;assembly=Microsoft.Xna.Framework"
             xmlns:editors="clr-namespace:UnityEditor.Controls.ComponentControl.Editors"
             mc:Ignorable="d" 
             d:DesignHeight="300" 
             d:DesignWidth="300" 
             DataContext="{Binding ComponentItem}"
             x:Name="componentControl" 
             Background="#FF7CBFE9" BorderBrush="#FF2347DC">

    <Border BorderBrush="#FF446FF3" BorderThickness="2,2,2,0">

        <StackPanel>
            <Border x:Name="PART_Header" 
				Focusable="False" 
				BorderThickness="0,1,1,0" 
				BorderBrush="DarkGray" d:LayoutOverrides="VerticalMargin">
                <DockPanel LastChildFill="False">
                    <Button DockPanel.Dock="Right" Command="{Binding Path=CloseCommand, ElementName=componentControl}" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="15" Height="15">
                        <Image Source="/UnityEditor;component/Images/PinClose.png" Stretch="Fill"/>
                    </Button>
                    <Button DockPanel.Dock="Right" Command="{Binding Path=CollapseCommand, ElementName=componentControl}" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="15" Height="15">
                        <Image Source="/UnityEditor;component/Images/PinDocMenu.png" Stretch="Fill"/>
                    </Button>
                    <TextBlock TextWrapping="Wrap" Text="{Binding SelectedObjectTypeName, ElementName=_propertyGrid}"/>
                </DockPanel>
            </Border>
            <Border x:Name="PART_Body" Focusable="False" 
				BorderThickness="1,1,1,0">
                <DockPanel>
                    <xctk:PropertyGrid Grid.Row="1" x:Name="_propertyGrid" Width="auto" Margin="2">
                        <xctk:PropertyGrid.EditorDefinitions>
                            <xctk:EditorDefinition TargetType="{x:Type xna:Vector2}">
                                <xctk:EditorDefinition.EditorTemplate>
                                    <DataTemplate>
                                        <Grid Margin="5">
                                            <editors:Vector2Editor Vector2Value="{Binding Value, Mode=TwoWay}"/>
                                        </Grid>
                                    </DataTemplate>
                                </xctk:EditorDefinition.EditorTemplate>
                            </xctk:EditorDefinition>
                            <xctk:EditorDefinition TargetType="{x:Type xna:Vector3}">
                                <xctk:EditorDefinition.EditorTemplate>
                                    <DataTemplate>
                                        <Grid Margin="5">
                                            <editors:Vector3Editor Vector3Value="{Binding Value, Mode=TwoWay}"/>
                                        </Grid>
                                    </DataTemplate>
                                </xctk:EditorDefinition.EditorTemplate>
                            </xctk:EditorDefinition>
                            <xctk:EditorDefinition TargetType="{x:Type xna:Vector4}">
                                <xctk:EditorDefinition.EditorTemplate>
                                    <DataTemplate>
                                        <Grid Margin="5">
                                            <editors:Vector4Editor Vector4Value="{Binding Value, Mode=TwoWay}"/>
                                        </Grid>
                                    </DataTemplate>
                                </xctk:EditorDefinition.EditorTemplate>
                            </xctk:EditorDefinition>
                        </xctk:PropertyGrid.EditorDefinitions>
                    </xctk:PropertyGrid>
                </DockPanel>
            </Border>
            <Button Content="Button" HorizontalAlignment="Left" Height="0" Width="4"/>
        </StackPanel>
    </Border>
</UserControl>